﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GJ_Model.Interface;
using GJ_Model.Factory;


namespace ProjectTest
{
    public partial class GJ_Main : Form
    {
        IGJ_Model_OperationOper GJ_Oper = GJ_Model_Factory.CreateGJ_Model_OperationOper();
        public GJ_Main()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                object ob = GJ_Oper.GetDataObject("");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        /// <summary>
        /// 查询点击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSelect_Click(object sender, EventArgs e)
        {
            BindGrid();
        }
        /// <summary>
        /// 绑定grid
        /// </summary>
        private void BindGrid()
        {
            try
            {
                DataTable gridDt = GJ_Oper.GetDataTableAll();
                this.gvResult.DataSource = gridDt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

    }
}
